<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="crm.model.Employees"%>
<%@page import="crm.util.ParamUtil"%>
<%@page import="crm.model.Week_sum"%>
<%@page import="crm.control.WeeksumControl"%>
<%@page import="crm.control.WeekplanControl"%>
<%@page import="crm.model.Week_plan"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
           request.setCharacterEncoding("UTF-8");
           Employees cu = (Employees) session.getAttribute("user");
           String all_plan_id1 = String.valueOf(session.getAttribute("all_plan_id"));
           int all_plan_id = Integer.parseInt(all_plan_id1);
           
           
           for(int i=1;i<8;i++){
           int id = ParamUtil.getInt(request,"id"+i+"");
           String date = ParamUtil.getString(request,"time"+i+"","");
           String content = ParamUtil.getString(request,"content"+i+"","");
           String helpPerson = ParamUtil.getString(request,"help_person"+i+"","");
           String description = ParamUtil.getString(request,"description"+i+"","");
           
           Week_plan weekPlan = new Week_plan();
           weekPlan.setDate(date);
           weekPlan.setContent(content);
           weekPlan.setHelp_person(helpPerson);
           weekPlan.setDescription(description);
               if(WeekplanControl.updateWeekPlan(weekPlan,id)){%>
               <script>
                  window.alert("成功");
                  window.top.location.href="w_plan.jsp?id=<%=all_plan_id%>";
               </script>
                   
               <%}else{%>
               <script>
                   window.alert("失败");
               </script>
               <%}%>
 <%        } %>
          

</body>
</html>